<template>
  <div class="qualityteam-container">
    <!-- 顶部标题 -->
    <el-row justify="center" class="header-row">
      <el-col :span="24" class="title">一冷运营区域质量日报</el-col>
    </el-row>

    <!-- 主体指标完成情况 -->
    <el-row :gutter="16" class="main-tables">
      <el-col :span="24">
        <el-card shadow="hover" class="stat-card">
          <div class="card-title">主体指标完成情况</div>
          <el-table :data="mainTargetData" border size="small">
            <el-table-column prop="itema" label="单元" align="center" />
            <el-table-column prop="itemb" label="归户" align="center" />
            <el-table-column label="原品种一次合格率（%）" align="center">
              <el-table-column prop="A1" label="目标" align="center" />
              <el-table-column label="当日" align="center">
                <el-table-column prop="A2" label="指标" width="70" align="center" />
                <el-table-column prop="A3" label="超降" width="70" align="center" />
              </el-table-column>
              <el-table-column label="月累" align="center">
                <el-table-column prop="A4" label="指标" width="70" align="center" />
                <el-table-column prop="A5" label="超降" width="70" align="center" />
              </el-table-column>
            </el-table-column>

            <el-table-column label="废次降率（%）" align="center">
              <el-table-column prop="B2" label="目标" align="center" />
              <el-table-column label="当日" align="center">
                <el-table-column prop="B2" label="指标" width="70" align="center" />
                <el-table-column prop="B3" label="超降" width="70" align="center" />
                <el-table-column prop="B4" label="废次降量（吨）" width="110" align="center" />
              </el-table-column>
              <el-table-column label="月累" align="center">
                <el-table-column prop="B5" label="指标" width="70" align="center" />
                <el-table-column prop="B6" label="超降" width="70" align="center" />
                <el-table-column prop="B7" label="废次降量（吨）" width="110" align="center" />
              </el-table-column>
            </el-table-column>

            <el-table-column label="封闭返工（吨）" align="center">
              <el-table-column prop="C1" label="目标" width="70" align="center" />
              <el-table-column prop="C2" label="当日" width="70" align="center" />
              <el-table-column prop="C3" label="目标" width="70" align="center" />
              <el-table-column prop="C4" label="月累" width="70" align="center" />
            </el-table-column>
          </el-table>
        </el-card>
      </el-col>
    </el-row>

    <!-- 折线图 -->
    <el-row :gutter="16" class="sub-tables">
      <!-- 原品种一次合格率趋势（%）各个单元 -->
      <el-col :span="12">
        <el-card class="tcm1-right-mid-card2" shadow="hover">
          <div style="width: 100%; height: 100%">
            <graph-line
              :data1="tcmELCCPKData1"
              :datax="tcmELCCPKDatax"
              :data-name="tcmELCCPKDataName1"
              :title="'原品种一次合格率趋势（%）各个单元'"
              :max="102"
              :min="88"
            />
          </div>
        </el-card>
      </el-col>

      <el-col :span="12">
        <el-card class="tcm1-right-mid-card2" shadow="hover">
          <div style="width: 100%; height: 100%">
            <graph-line
              :data1="tcmELCCPKData2"
              :datax="tcmELCCPKDatax"
              :data-name="tcmELCCPKDataName2"
              :title="'废次降率趋势（%）各个单元'"
              :max="102"
              :min="88"
            />
          </div>
        </el-card>
      </el-col>

      <!-- <el-col :span="8">
        <el-card shadow="hover" class="stat-card">
          <div class="tcm1-mid-mid-card2-graph common-div-card">
              <graph-bar-other
                :data1="speProdSteel1"
                :data2="speProdSteel2"
                :datax="speProdSteelx"
                :title="'汽车板残次率（%）'"
                :max="10000"
                :min="0"
              />
            </div>
        </el-card>
      </el-col> -->
    </el-row>
  </div>
</template>

<script setup lang="ts">
  import { ref } from 'vue';
  import GraphBarOther from '../../components/GraphBarOther.vue';
  import GraphLine from '../../components/GraphLine.vue';

  //主指标情况，表格数据
  const mainTargetData = [
    {
      itema: '酸轧',
      itemb: '生产',
      A1: 100,
      A2: 110,
      A3: 254,
      A4: 578,
      A5: 154,
      B1: 248,
      B2: 577,
      B3: 540,
      B4: 550,
      B5: 560,
      B6: 570,
      B7: 580,
      C1: 590,
      C2: 600,
      C3: 610,
      C4: 620,
    },
    {
      itema: '酸轧',
      itemb: '设备',
      A1: 120,
      A2: 457,
      A3: 278,
      A4: 874,
      A5: 258,
      B1: 365,
      B2: 874,
      B3: 99,
      B4: 874,
      B5: 147,
      B6: 204,
      B7: 741,
      C1: 258,
      C2: 369,
      C3: 963,
      C4: 741,
    },
    {
      itema: '普冷',
      itemb: '生产',
      A1: 134,
      A2: 578,
      A3: 120,
      A4: 130,
      A5: 460,
      B1: 520,
      B2: 530,
      B3: 540,
      B4: 550,
      B5: 560,
      B6: 570,
      B7: 580,
      C1: 590,
      C2: 600,
      C3: 610,
      C4: 620,
    },
    {
      itema: '普冷',
      itemb: '设备',
      A1: 154,
      A2: 145,
      A3: 547,
      A4: 159,
      A5: 460,
      B1: 357,
      B2: 841,
      B3: 951,
      B4: 550,
      B5: 560,
      B6: 570,
      B7: 580,
      C1: 590,
      C2: 600,
      C3: 610,
      C4: 620,
    },
    {
      itema: '镀锌',
      itemb: '生产',
      A1: 125,
      A2: 247,
      A3: 120,
      A4: 130,
      A5: 460,
      B1: 520,
      B2: 530,
      B3: 540,
      B4: 324,
      B5: 560,
      B6: 570,
      B7: 580,
      C1: 590,
      C2: 600,
      C3: 610,
      C4: 620,
    },
    {
      itema: '镀锌',
      itemb: '设备',
      A1: 324,
      A2: 257,
      A3: 120,
      A4: 130,
      A5: 460,
      B1: 520,
      B2: 530,
      B3: 540,
      B4: 550,
      B5: 159,
      B6: 570,
      B7: 580,
      C1: 590,
      C2: 600,
      C3: 610,
      C4: 620,
    },
    {
      itema: '超博',
      itemb: '生产',
      A1: 147,
      A2: 587,
      A3: 120,
      A4: 130,
      A5: 460,
      B1: 520,
      B2: 530,
      B3: 540,
      B4: 550,
      B5: 560,
      B6: 459,
      B7: 580,
      C1: 590,
      C2: 600,
      C3: 610,
      C4: 620,
    },
    {
      itema: '超博',
      itemb: '设备',
      A1: 257,
      A2: 784,
      A3: 120,
      A4: 130,
      A5: 460,
      B1: 520,
      B2: 530,
      B3: 540,
      B4: 550,
      B5: 560,
      B6: 570,
      B7: 748,
      C1: 590,
      C2: 600,
      C3: 610,
      C4: 620,
    },
    {
      itema: '保障',
      itemb: '磨辊',
      A1: 348,
      A2: 201,
      A3: 120,
      A4: 130,
      A5: 460,
      B1: 520,
      B2: 530,
      B3: 540,
      B4: 550,
      B5: 560,
      B6: 570,
      B7: 580,
      C1: 325,
      C2: 600,
      C3: 610,
      C4: 620,
    },
    {
      itema: '保障',
      itemb: '公辅',
      A1: 245,
      A2: 354,
      A3: 120,
      A4: 130,
      A5: 460,
      B1: 520,
      B2: 530,
      B3: 540,
      B4: 550,
      B5: 560,
      B6: 570,
      B7: 580,
      C1: 590,
      C2: 587,
      C3: 610,
      C4: 620,
    },
    {
      itema: '保障',
      itemb: '运转',
      A1: 478,
      A2: 658,
      A3: 120,
      A4: 130,
      A5: 460,
      B1: 520,
      B2: 530,
      B3: 540,
      B4: 550,
      B5: 560,
      B6: 570,
      B7: 580,
      C1: 590,
      C2: 600,
      C3: 125,
      C4: 620,
    },
    {
      itema: '其它',
      itemb: '',
      A1: 75,
      A2: 424,
      A3: 120,
      A4: 130,
      A5: 460,
      B1: 520,
      B2: 530,
      B3: 540,
      B4: 550,
      B5: 560,
      B6: 570,
      B7: 580,
      C1: 590,
      C2: 600,
      C3: 610,
      C4: 998,
    },
    {
      itema: '合计',
      itemb: '',
      A1: 1254,
      A2: 2548,
      A3: 120,
      A4: 130,
      A5: 460,
      B1: 520,
      B2: 530,
      B3: 540,
      B4: 550,
      B5: 560,
      B6: 570,
      B7: 580,
      C1: 590,
      C2: 600,
      C3: 610,
      C4: 324,
    },
  ];

  //主指标情况，柱状图数据center
  const speProdSteel1 = ref<any>([5475, 8547, 3254]); // 7456, 7456, 7456, 7456
  const speProdSteel2 = ref<any>([7456, 3247, 5589]); // 7456, 7456, 7456, 7456
  const speProdSteelx = ref<any>(['一冷', '三冷', '总厂']);

  // 折线图
  const tcmELCCPKData1 = ref<any>([98, 100, 92, 96, 102]);
  const tcmELCCPKData2 = ref<any>([89, 88, 98, 95, 101]);
  const tcmELCCPKDatax = ref<any>(['7月22日', '7月23日', '7月24日', '7月25日', '7月26日']);
  const tcmELCCPKDataName1 = ref<any>(['']); //合格率
  const tcmELCCPKDataName2 = ref<any>(['']); //废次率

  //汽车板生产情况，表格数据
  const CarSteel1 = ref<any>([156, 151, 547]);
  const CarSteel2 = ref<any>([257, 255, 874]);
  const CarSteel3 = ref<any>([478, 398, 1375]);
  const CarSteelx = ref<any>(['内板', '外板', '合计']);

  onBeforeMount(() => {});
</script>

<style lang="less" scoped>
  @border-radius: 8px;
  @primary-color: #2c69e8;
  @box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  @box-shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.12);
  @border:1px solid #dcdfe6;

  .tcm1-right-mid-card2 {
    width: 100%;
    height: 25vh;
    flex-wrap: nowrap;
    margin-top: 1vh;

    :deep(.el-card__body) {
      display: flex;
      justify-content: space-between;
      width: 100%;
      height: 100%;
    }
  }

  .qualityteam-container {
    padding: 18px 18px 0 18px;
    background: #f6f8fa;
  }
  .header-row .title {
    font-size: 2rem;
    font-weight: bold;
    color: #009966;
    letter-spacing: 0.5em;
    text-align: center;
    margin-bottom: 18px;
  }
  .card-title {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 8px;
  }
  .stat-card {
    margin-bottom: 16px;
  }
  .device-issue-row {
    margin-bottom: 16px;
  }
  .device-issue-card {
    background: #fffbe6;
  }
  .device-issue-content {
    color: #333;
    font-size: 0.98rem;
    line-height: 1.7;
    margin-top: 8px;
  }
  .bottom-card {
    margin-top: 18px;
  }
  .search-bar {
    margin-bottom: 0;
  }
  .center-panel {
    width: 33.33%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: space-between;
  }
  .center-row {
    width: 100%;
    height: 50%;
  }
  .card-bj {
    background-image: url('/src/assets/images/cut331.png');
    height: 26px;
    padding-top: 5px;
    margin-bottom: 4px;
  }
  .tcm1-mid-mid-card2-graph {
    height: 25vh;
    width: 100%;
    margin-top: 1vh;
    box-shadow: @box-shadow;
    border-radius: @border-radius;
  }
</style>
